// 页面缩放
fnViewScale();
function fnViewScale() {
    var web_wrap = $("#web_wrap")[0];
    var web_wrap1 = $(".pao_box")[0];
    var sreenWidth = document.body.clientWidth;
    var iScale = sreenWidth / 320;
    if (web_wrap!=undefined) {
        web_wrap.style.transform = "scale(" + iScale + ")";
        web_wrap.style.webkitTransform = "scale(" + iScale + ")";
    }
    if (web_wrap1!=undefined) {
        web_wrap1.style.transform = "scale(" + iScale + ")";
        web_wrap1.style.webkitTransform = "scale(" + iScale + ")";
    }

}
window.onresize = function () {
    fnViewScale();
}


// 按钮绑定
fnGlobaA();
function fnGlobaA() {
    var globalA = $("a");

    for (var i = 0; i < globalA.length; i++) {
        globalA[i].addEventListener('touchstart', function () { }, false);
    }
}


$.extend({
    GetPhb: function (pn, ui, sz) {
        if (isNaN(sz) || sz == 0)
            sz = 10;
        if ($('.nameline>.name').text().indexOf('到底了') == -1) {
            $.ajax({
                url: 'Paihb.aspx',
                type: 'POST',
                dataType: 'html',
                data: { pn: pn, sz: sz, ui: ui },
            })
                .done(function (data) {
                    $('.namebox').append(data);
                })
                .fail(function () {
                    $('.namebox').html('<div class="nameline" style="margin-top: 60px;"><div class="name">到底了!</div></div>');
                })
                .always(function () {

                });
        }
    }
});

$.fn.Exist = function () {
    return this.length > 0;
}
function GetFenYe(ui, sz) {
    pn = 1;
    if ($('#currentPage').Exist()) {
        num = parseInt($('#currentPage').val());
        if (isNaN(num))
            num = 0;
        pn = num + 1;
        $('#currentPage').val(pn);
    }
    $.GetPhb(pn, ui, sz);
}
